<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*
        1. 语法错误
        2. 运行时错误
        3. 逻辑错误
        */
        // const age = -1;
        // if (age >= 1 && age < 100) {
        //     console.log(age);
        // } else {
        //     console.log('age must >=1 && <100');
        // }

        const data = `{"name":"jack","age":20}`;
        try {
            // 抛出错误
            console.log(JSON.parse(data));
            console.log('success');
        } catch (e) {
            console.log('error');
        }



    </script>
</body>

</html>